import json

from wx_util import get_access_token, send_message

if __name__ == "__main__":
    with open("config-prod.json", encoding="utf-8") as f:
        config = json.load(f)

    accessToken = get_access_token(config["app_id"], config["app_secret"])
    template_id = config["template_id"]
    chp_key = config["chp_key"]
    weather_key = config["weather_key"]

    for to_user, user_info in config["user_list"].items():
        send_message(to_user, user_info, accessToken, template_id, chp_key, weather_key)

    print("发送完毕~")
